<template>
  <div class="home">
    <ProductList status="在售" />
    <div class="home-actions">
      <el-button
        type="primary"
        class="publish-btn"
        circle
        icon="el-icon-plus"
        @click="goToPublish"
      >
        <span class="publish-text">发闲置</span>
      </el-button>
    </div>
  </div>
</template>

<script>
import ProductList from '@/components/ProductList.vue'

export default {
  name: 'HomeRegisterView',
  components: {
    ProductList
  },
  methods: {
    goToPublish() {
      this.$router.push('/publish')
    }
  }
}
</script>

<style scoped>
.home {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.home-actions {
  position: fixed;
  right: 40px;
  bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-end;
}
.publish-btn {
  width: 60px;
  height: 60px;
  background-color: #ffd700;
  border-color: #ffd700;
  color: #333;
  font-size: 16px;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.1);
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0;
}
.publish-btn:hover {
  transform: scale(1.1);
  background-color: #ffed4a;
  border-color: #ffed4a;
}
.publish-text {
  font-size: 12px;
  margin-top: 2px;
}
.publish-btn .el-icon-plus {
  font-size: 20px;
  margin-bottom: 2px;
}
</style> 